home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
basic
/
digclk12.zip
/
DIGCLOCK.FRM
< prev
next >
Wrap
Text File
|
1994-09-27
|
9KB
|
298 lines
VERSION 2.00
Begin Form frmClock
BorderStyle = 1 'Fixed Single
ClientHeight = 735
ClientLeft = 3240
ClientTop = 855
ClientWidth = 2730
ControlBox = 0 'False
ForeColor = &H00FF0000&
Height = 1170
Icon = DIGCLOCK.FRX:0000
Left = 3165
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = DIGCLOCK.FRX:0302
ScaleHeight = 735
ScaleWidth = 2730
Top = 495
Width = 2880
Begin PictureClip picNumbers
Cols = 13
Location = "3705,525,1170,-60"
Picture = DIGCLOCK.FRX:0520
End
Begin SSPanel pnlClock
BevelInner = 1 'Inset
BevelWidth = 2
Height = 735
Left = 0
TabIndex = 0
Top = 0
Width = 2730
Begin PictureBox picClock
BackColor = &H00000000&
BorderStyle = 0 'None
Height = 525
Left = 105
ScaleHeight = 525
ScaleWidth = 2505
TabIndex = 1
Top = 105
Width = 2505
Begin Image imgNum
Height = 525
Index = 7
Left = 2205
Top = 0
Width = 285
End
Begin Image imgNum
Height = 525
Index = 6
Left = 1890
Top = 0
Width = 285
End
Begin Image imgNum
Height = 525
Index = 5
Left = 1575
Top = 0
Width = 285
End
Begin Image imgNum
Height = 525
Index = 0
Left = 0
Top = 0
Width = 285
End
Begin Image imgNum
Height = 525
Index = 1
Left = 315
Top = 0
Width = 285
End
Begin Image imgNum
Height = 525
Index = 2
Left = 630
Top = 0
Width = 285
End
Begin Image imgNum
Height = 525
Index = 3
Left = 945
Top = 0
Width = 285
End
Begin Image imgNum
Height = 525
Index = 4
Left = 1260
Top = 0
Width = 285
End
End
End
Begin Timer Timer1
Interval = 1000
Left = 3120
Top = 1680
End
Begin Image imgGreen
Height = 525
Left = 0
Picture = DIGCLOCK.FRX:168E
Top = 1920
Width = 3705
End
Begin Image imgRed
Height = 525
Left = 0
Picture = DIGCLOCK.FRX:27FC
Top = 2400
Width = 3705
End
End
Option Explicit
Sub cmdEnd_Click ()
End Sub
Sub Form_Load ()
Dim Success%
Dim Temp
Dim ReturnString As String
Dim ReturnSize As Integer
Dim CurrentPath As String
Dim TempString As String
ReturnString = Space$(128)
ReturnSize = Len(ReturnString)
Temp = GetPrivateProfileString("DigClock", "Left", "0", ReturnString, ReturnSize, "digclock.ini")
ReturnString = Left(ReturnString, Temp)
Me.Left = Val(ReturnString)
ReturnString = Space$(128)
Temp = GetPrivateProfileString("DigClock", "Top", "0", ReturnString, ReturnSize, "digclock.ini")
ReturnString = Left(ReturnString, Temp)
Me.Top = Val(ReturnString)
ReturnString = Space$(128)
Temp = GetPrivateProfileString("DigClock", "Color", "0", ReturnString, ReturnSize, "digclock.ini")
ReturnString = Left(ReturnString, Temp)
If Val(ReturnString) = 0 Then
picNumbers.Picture = imgRed.Picture
ClockColor = 0
Else
picNumbers.Picture = imgGreen.Picture
ClockColor = 1
End If
ReturnString = Space$(128)
Temp = GetPrivateProfileString("DigClock", "TimeFormat", "12", ReturnString, ReturnSize, "digclock.ini")
ReturnString = Left(ReturnString, Temp)
If Val(ReturnString) = 12 Then
TimeFormat = 12
Else
TimeFormat = 24
End If
ReturnString = Space$(128)
Temp = GetPrivateProfileString("DigClock", "OnTop", "0", ReturnString, ReturnSize, "digclock.ini")
ReturnString = Left(ReturnString, Temp)
If Val(ReturnString) = 1 Then
Success% = SetWindowPos(frmClock.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
OnTop = 1
Else
Success% = SetWindowPos(frmClock.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
OnTop = 0
End If
ReturnString = Space$(128)
Temp = GetPrivateProfileString("DigClock", "SecondsOn", "0", ReturnString, ReturnSize, "digclock.ini")
ReturnString = Left(ReturnString, Temp)
If Val(ReturnString) = 1 Then
picClock.Width = 2500
pnlClock.Width = 2730
Me.Width = 2765
SecondsOn = 1
' Turn on Colons
imgNum(2).Picture = picNumbers.GraphicCell(10)
imgNum(5).Picture = picNumbers.GraphicCell(10)
Else
picClock.Width = 1560
pnlClock.Width = 1770
Me.Width = 1800
SecondsOn = 0
End If
Load frmOptions
End Sub
Sub Form_Unload (Cancel As Integer)
Dim Temp
Dim TempString As String
TempString = Trim(Str(Me.Left))
Temp = WritePrivateProfileString("DigClock", "Left", TempString, "digclock.ini")
TempString = Trim(Str(Me.Top))
Temp = WritePrivateProfileString("DigClock", "Top", TempString, "digclock.ini")
TempString = Trim(Str(OnTop))
Temp = WritePrivateProfileString("DigClock", "OnTop", TempString, "digclock.ini")
TempString = Trim(Str(ClockColor))
Temp = WritePrivateProfileString("DigClock", "Color", TempString, "digclock.ini")
TempString = Trim(Str(TimeFormat))
Temp = WritePrivateProfileString("DigClock", "TimeFormat", TempString, "digclock.ini")
TempString = Trim(Str(SecondsOn))
Temp = WritePrivateProfileString("DigClock", "SecondsOn", TempString, "digclock.ini")
End
End Sub
Sub imgNum_MouseUp (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim mpos As POINTAPI
Dim p As ConvertPOINTAPI
Dim ret As Integer
Call GetCursorPos(mpos) ' Get the current position of the cursor
LSet p = mpos ' and convert it for SendMessage calls.
' Now tell the form someone is clicking the window caption:
ret = Sendmessage(Me.hWnd, WM_SYSCOMMAND, MOUSE_MOVE, p.xy)
End Sub
Sub Picture1_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim mpos As POINTAPI
Dim p As ConvertPOINTAPI
Dim ret As Integer
Call GetCursorPos(mpos) ' Get the current position of the cursor
LSet p = mpos ' and convert it for SendMessage calls.
' Now tell the form someone is clicking the window caption:
ret = Sendmessage(Me.hWnd, WM_SYSCOMMAND, MOUSE_MOVE, p.xy)
End Sub
Sub pnlClock_DblClick ()
frmOptions.Show
End Sub
Sub pnlMenu_DblClick ()
frmOptions.Show
End Sub
Sub Timer1_Timer ()
Dim Current
Dim X As Integer
If TimeFormat = 12 And SecondsOn = 0 Then
Current = Format(Now, "HH:MM AM/PM")
End If
If TimeFormat = 24 And SecondsOn = 0 Then
Current = Format(Now, "HH:MM")
End If
If TimeFormat = 12 And SecondsOn = 1 Then
Current = Format(Now, "HH:MM:SS AM/PM")
End If
If TimeFormat = 24 And SecondsOn = 1 Then
Current = Format(Now, "HH:MM:SS")
End If
If Current <> OldTime Then
If Left(Current, 1) = "0" Then
imgNum(0).Picture = picNumbers.GraphicCell(12)
Else
imgNum(0).Picture = picNumbers.GraphicCell(Val(Left(Current, 1)))
End If
X = Val(Mid(Current, 2, 1))
imgNum(1).Picture = picNumbers.GraphicCell(X)
X = Val(Mid(Current, 4, 1))
imgNum(3).Picture = picNumbers.GraphicCell(X)
X = Val(Mid(Current, 5, 1))
imgNum(4).Picture = picNumbers.GraphicCell(X)
If SecondsOn Then
X = Val(Mid(Current, 7, 1))
imgNum(6).Picture = picNumbers.GraphicCell(X)
X = Val(Mid(Current, 8, 1))
imgNum(7).Picture = picNumbers.GraphicCell(X)
End If
End If
If SecondsOn = 0 Then
If ColonOn Then
ColonOn = False
imgNum(2).Picture = picNumbers.GraphicCell(11)
Else
ColonOn = True
imgNum(2).Picture = picNumbers.GraphicCell(10)
End If
End If
End Sub